<template>
	<view class="searchBox">
		
		<view class="listBox" >
			<view class="list" v-for="l in list" :key="l.id" @click="goZLDetail(l)">
				<view class="title">{{l.firmName}}</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default{
		data(){
			return{
				hisoryData:[],
				keyword:'',
				list:[]
				
			}
		},
		components: {
			
		},
		onLoad() {
			if(this.$SysCache.get('historyData')){
				this.hisoryData = this.$SysCache.get('historyData')
			}
			
		},
		methods:{
			setStorage(text){
				let searchData = {
					keyword:text
				}
				this.$http.get('/patent/getFirmByTax', searchData).then(res => {
					if (res.code == '0') {
						this.list = res.data;
					}
				})
			},
			search(text){
				var webView = this.$mp.page.$getAppWebview(); 
				webView.setTitleNViewSearchInputText(text)
				this.setStorage(text)
			},
			goZLDetail(item){
				this.$api.prePage().getItem(item)
				uni.navigateBack({
					
				})
			}
		},
		onNavigationBarSearchInputConfirmed(e){
			console.log(e)
			this.setStorage(e.text)
		}
	}
</script>

<style scoped lang="scss">
	.uni-page-head-search-placeholder:before{
		font-size: 24px !important;
	}
	.searchBox{
		.top{
			padding: 30upx;
			font-size: 28upx;
			color: #33333B;
			.delBtn{
				width:116upx;
				height:50upx;
				background:rgba(242,242,247,1);
				border-radius:8upx;
				color: #999;
				font-size: 24upx;
				justify-content: center;
				align-items: center;
				image{
					width: 24upx;
					height: 26upx;
					margin-right: 12upx;
				}
			}
		}
		.hisory{
			padding:0 30upx;
			overflow: hidden;
			>view{
				float: left;
				max-width:110upx;
				height:56upx;
				padding: 0 25upx;
				border:1px solid rgba(203,203,209,1);
				opacity:0.8;
				border-radius:8upx;
				font-size: 26upx;
				color: #9999A1;
				line-height: 56upx;
				text-align: center;
				margin-right: 12upx;
				margin-bottom: 12upx;
				// display: inline-flex;
				&:nth-child(4n){
					margin-right: 0;
				}
			}
		}
		.listBox{
			margin-top: 20upx;
			background: #fff;
			padding:0 30upx;
			.list{
				padding:30upx 0 ;
				border-bottom: 1upx solid rgba(238,238,238,1);
				&:last-child{
					border-bottom: none;
				}
				.title{
					font-size: 32upx;
					color: #22222A;
					font-weight: bold;
				}
				.tagList{
					padding-top: 23upx;
					padding-bottom: 23upx;
					>view{
						font-size: 22upx;
						color: #FD580A;
						border:1upx solid #FD580A;
						padding: 5upx 10upx;
						margin-right: 16upx;
						border-radius: 8upx;
						
					}
				}
				.classList{
					color: #38D214;
					font-size: 26upx;
					// flex-wrap: wrap;
					>view{
						display: inline-flex;
						background: url(../../static/icon/green.png) no-repeat left 13upx;
						background-size: 8upx 8upx;
						padding-left: 20upx;
						margin-right: 37upx;
						padding-bottom: 20upx;
						&:first-child{
							margin-left: 0;
						}
					}
				}
				.desc{
					color: #666666;
					font-size: 28upx;
					
				}
			}
		}
	}
</style>
